Disable GdkSurface.minimize on Wayland
authorEmmanuele Bassi <ebassi@gnome.org>
Sat, 16 Nov 2019 20:04:00 +0000 (20:04 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Sat, 16 Nov 2019 20:25:01 +0000 (20:25 +0000)
The existing xdg-shell protocols do not support minimization in a way
that allows us to implement the GdkSurface API; the only minimization
operation does not come with a state notification, nor it comes with
a way to undo itself.

Closes: #67
gdk/wayland/gdksurface-wayland.c

index e29039df75e56f33afc0ed137f2b824391d5dcaa..c24091c607e378e5513c8d6f6e6c1e766656a0fd 100644 (file)
@@ -3275,9 +3275,6 @@ gdk_wayland_surface_set_icon_name (GdkSurface  *surface,
 static void
 gdk_wayland_surface_minimize (GdkSurface *surface)
 {
-  GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
-  GdkWaylandDisplay *display_wayland;
-
   if (GDK_SURFACE_DESTROYED (surface) ||
       !SURFACE_IS_TOPLEVEL (surface))
     return;
@@ -3285,6 +3282,14 @@ gdk_wayland_surface_minimize (GdkSurface *surface)
   if (!is_realized_toplevel (surface))
     return;
 
+#if 0
+  GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
+  GdkWaylandDisplay *display_wayland;
+
+  /* We cannot use set_minimized() because it does not come with a
+   * minimized state that we can query or get notified of. This means
+   * we cannot implement the full GdkSurface API
+   */
   display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
   switch (display_wayland->shell_variant)
     {
@@ -3297,6 +3302,7 @@ gdk_wayland_surface_minimize (GdkSurface *surface)
     default:
       g_assert_not_reached ();
     }
+#endif
 }
 
 static void
@@ -3306,15 +3312,16 @@ gdk_wayland_surface_unminimize (GdkSurface *surface)
       !SURFACE_IS_TOPLEVEL (surface))
     return;
 
+#if 0
   if (GDK_SURFACE_IS_MAPPED (surface))
     {
       gdk_surface_show (surface);
     }
   else
     {
-      /* Flip our client side flag, the real work happens on map. */
       gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_MINIMIZED, 0);
     }
+#endif
 }
 
 static void